#pragma once
#include "cUrlFile.h"
#include "IniFile.h"
#include "Global_Tools.h"
#include "Cdiv.h"
#include "Cparser.h"
#include "IoFile.h"
#include "CHttpDown.h"
#include "MultThreadDown.h"


#define MAXTHREAD 62
class CWinmider
{
public:
	CWinmider(void);
	~CWinmider(void);

	BOOLEAN IniFileRead();
	int Start(void);
	void SetPath(void);
	LPCSTR iniFileName;
	LPCSTR m_szPath;
	LPCSTR m_szImagePath[MAX_PATH];
	GTools tools;
private:
	CURLcode LoopStart();
	CURLcode OnceStart( LPCSTR sUrl , int nCount);
	CURLcode ChildStart(CHttpUrl* httpurl);
	VOID ImageDown( CHttpUrl* httpurl );
	VOID GetCurrentPath();
	VOID GetIniVariable(IniFile* ini, Cdiv*& divs , LPCTSTR section, LPCTSTR key);

	BOOLEAN m_IsPages;
	TCHAR m_url[MAX_PATH];
	TCHAR m_http[MAX_PATH];
	LPTSTR gBuffer;
	Cdiv* m_divs, *m_divsChild, *m_Divs_A, *m_DivsChild_A;
	string m_href, m_title, m_BreakPoint;
	int m_ifrom, m_ito, m_thread;
	CIoFile m_ioFile;
	IniFile* m_iniFile;

	MultThreadDown m_MDown;
		

};
